<template>
	<view class="container">
		<view class="bill">
			<Bill title="热水消费单据" :no="billDetail.consumptionId">
				<view class="detail_item">
					<view class="detail_title">支付金额</view>
					<view class="detail_content advance_amount">{{(billDetail.payTime!=null?'-':'') + billDetail.advanceAmount}} 元</view>
				</view>
				<view class="detail_item">
					<view class="detail_title">使用设备</view>
					<view class="detail_content">{{billDetail.deviceNo}}</view>
				</view>
				<view class="detail_item">
					<view class="detail_title">所在区域</view>
					<view class="detail_content">{{billDetail.orgName}}</view>
				</view>
				<view class="detail_item">
					<view class="detail_title">支付方式</view>
					<view class="detail_content">
						<view class="icon_box" v-if="billDetail.payType == 1">
							<image class="paytype_icon" src="../../../static/images/hotWater/pay_card.png" mode="scaleToFill"></image> IC卡
						</view>
						<!-- #ifdef MP-ALIPAY -->
						<view class="icon_box" v-else>
							<image class="paytype_icon" src="../../../static/images/hotWater/pay_mypay.png" mode="scaleToFill"></image> 支付宝
						</view>
						<!-- #endif -->
						<!-- #ifdef MP-WEIXIN -->
						<view class="icon_box" v-else>
							<image class="paytype_icon" src="../../../static/images/hotWater/pay_wechat.png" mode="scaleToFill"></image> 微信
						</view>
						<!-- #endif -->
					</view>
				</view>
				<view class="detail_item" v-if="billDetail.payType == 1">
					<view class="detail_title">IC卡号</view>
					<view class="detail_content">{{billDetail.cardNo}}</view>
				</view>
				<view class="detail_item" v-if="billDetail.refundStatus == 2 && billDetail.refundAmount > 0">
					<view class="detail_title">退款金额</view>
					<view class="detail_content refund_amount">+{{billDetail.refundAmount}} 元</view>
				</view>
				<view class="detail_item" v-if="billDetail.payTime!=null && billDetail.payStatus != 1">
					<view class="detail_title">支付时间</view>
					<view class="detail_content">{{billDetail.payTime}}</view>
				</view>
				<view class="detail_item" v-else>
					<view class="detail_title">支付状态</view>
					<view class="detail_content" style="color: #E74c3c;">未支付</view>
				</view>
				<view class="footer_slot" slot="footer">
					注：本次消费如有退款，将会在一分钟内原路退回支付账户，请在相关账户确认退款金额到账情况 <br>
				</view>
			</Bill>
		</view>
	</view>
</template>

<script>
	import Bill from '@/components/bill/bill.vue'
	export default {
		components: {
			Bill
		},
		data() {
			return {
				billDetail: {}
			};
		},
		onLoad(options) {
			this.billDetail = JSON.parse(options.detail)
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.container{
		height: 100vh;
		background-color: #F1F0F5;
	}
	.bill {
		background: #FFF;
		margin: 0 24upx;
	}

	.footer_slot {
		padding: 32upx 0;
		color: #858b9c;
		font-size: 22upx;
		line-height: 1.5;
		border-top: 1px solid #e1e4eb;
	}

	.detail_item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		line-height: 1.35;
		font-size: 28upx;
		padding-top: 12upx;
		padding-bottom: 12upx;

		.detail_title {
			flex-shrink: 0;
			color: #858b9c;
		}

		.detail_content {
			flex: 1 1 0%;
			color: #41485d;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			margin-left: 12px;

			&.advance_amount {
				color: #E74c3c;
				font-size: 46upx;
			}

			&.refund_amount {
				color: #F0AD4E;
				font-size: 46upx;
			}

			.paytype_icon {
				width: 32upx;
				height: 32upx;
				line-height: 32upx;
				margin-right: 10upx;
			}

			.icon_box {
				display: flex;
				align-items: center;
				justify-content: flex-end;
			}
		}
	}
</style>
